<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>壹码当先 - 用户登录</title>
  <link href="/pages/css/kefu.css" rel="stylesheet">
  <script type="text/javascript" src="/pages/js/jquery001.js"></script>
  <script type="text/javascript" src="/pages/js/jquery.min.js"></script>
  <!-- Chosen CSS -->
  <link href="/pages/css/login-register.css" rel="stylesheet">
  <!-- Pretty Photo CSS -->
  <link href="/pages/css/prettyPhoto.css" rel="stylesheet">
  <!-- User + Register CSS -->
  <link href="/pages/css/login-register.css" rel="stylesheet">
  <!-- Custom Main StyleSheet CSS -->
  <link href="/pages/style.css" rel="stylesheet">
  <!-- Color CSS -->
  <link href="/pages/css/color.css" rel="stylesheet">
  <link href="/pages/css/color-2.css" rel="stylesheet">
  <!-- Responsive CSS -->
  <link href="/pages/css/responsive.css" rel="stylesheet">
    <script type="text/javascript">
      $(function () {

              $("#UserLogin").click(function () {
                  var mobile = $("#LoginMobile").val(),
                      password = $("#LoginPassword").val();
                  var url = "/user/login";
                  $.post(url, {
                      mobile: mobile,
                      password: password
                  }, function (result) {
                      if (result.status === 1){
                          alert("登录成功");
                          window.location.href = "/pages/index.html";
                      }
                      else {
                          alert("登陆失败");
                      }
                      //alert(JSON.stringify(result));
                  })
              });

              $("#UserRegister").click(function () {
                  var mobile = $("#RegisterMobile").val(),
                      verificationCode = $("#VerificationCode").val(),
                      password = $("#RegisterPassword").val(),
                      againpassword = $("#AgainPassword").val();
                  var url = "/user/register";
                  if(password == againpassword) {
                      $.post(url, {
                          mobile: mobile,
                          verificationCode: verificationCode,
                          password: password
                      }, function (result) {
                          if (result.status === 1) {
                              alert("注册成功");
                              window.location.href = "/pages/index.html";
                          }
                          else {
                              alert("注册失败");
                          }
                         // alert(JSON.stringify(result));
                      })
                  }
                  else{
                      alert("密码不一致！");
                  }
              });
          })

      function getVerificationCode(){
          var mobile = $("#RegisterMobile").val();
          var verificationType =1;
          var url = "/user/verification";
          $.post(url, {
              mobile: mobile,
              verificationType: verificationType
          }, function (result) {
              if (result.status === 0){
                  alert("获取验证码失败");
              }

              //alert(JSON.stringify(result));
          })
      }
  </script>

  </head>

<body>
  <!--gt Wrapper Start-->  
  <div class="gt_wrapper">
    <!--Header Wrap Start-->
    <header class="gt_hdr2_wrap">
      <div class="gt_top2_wrap default_width">
        <div class="container">
          <!-- <div class="gt_top_element">
            <ul>
              <li><a href="#">Student</a></li>
              <li><a href="#">Faculty  Staff</a></li>
              <li><a href="#">Parents</a></li>
              <li><a href="#">Allmni</a></li>
            </ul>
          </div> -->
          <!-- <div class="gt_hdr_2_ui_element">
            <ul>
              <li><i class="icon-lock"></i><a href="login-register.html">登录 &#38; 注册</a></li>
              <li>
                  <div class="gt-user-login">
                      <div class="gt-media">
                          <figure><img alt="" src="../../extra-images/popular-course-icon.png"></figure>
                      </div>
                      <a href="../users/information.html">xxx</a>
                      <ul>
                          <li><a href="../users/information.html"><i class="fa fa-user"></i> 个人信息</a></li>
                          <li><a href="myworks.html"><i class="fa fa-file"></i> 我的作品</a></li>
                          <li><a href="#"><i class="fa fa-sign-out"></i> 退出</a></li>
                      </ul>
                  </div>
              </li>
            </ul>
          </div> -->
          <!-- <div class="gt_login_element">
            <p>Apply Program &#38; Degress  -   Find Funding</p>
          </div> -->
        </div>
      </div>
      <div class="gt_menu_bg default_width">
        <div class="container">
          <!--Logo Wrap Start-->
          <div class="gt_logo gt_logo_padding">
            <a href="/pages/index.html"><img src="/pages/images/logo-2.png" alt=""></a>
          </div>
          <!--Logo Wrap End-->
          <!--Search Wrap Start-->
          <!-- <div class="gt_search_wrap">
            <span class="search-fld"><i class="fa fa-search"></i></span>
              <div class="search-wrapper-area">
                  <form class="search-area">
                      <input type="text" placeholder="Search Here"/>
                      <input type="submit" value="Go"/>
                  </form>
                  <span class="gt_search_remove_btn"><i class="fa fa-remove"></i></span>
              </div>
          </div> -->
          <!-- Search Wrap End -->
          <!--Navigation Wrap Start-->
          <!-- <nav class="gt_navigation2">
            <button class="gt_mobile_menu">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <ul>
              <li class="active"><a href="../../index.html">首页</a></li>
              <li><a href="../course/course.html">课程介绍</a></li>
              <li><a href="../showpages/showworks.html">作品展示</a></li>
              <li><a href="../news/news.html">新闻资讯</a></li>
              <li><a href="../showpages/aboutus.html">关于我们</a></li>
              <li><a href="../showpages/cooperation.html">企业合作</a></li>
            </ul>
          </nav> -->
          <!--Navigation Wrap End-->
        </div>
      </div>
    </header>
    <!--Header Wrap End-->

    <!--Sub Banner Wrap Start -->
    <div class="gt_sub_banner_bg default_width">
      <div class="container">
        <div class="gt_sub_banner_hdg  default_width">
          <h2>登录 / 注册</h2>
          <h6>壹码当先&nbsp;·&nbsp;让更多的孩子爱上编程</h6>
        </div>
      </div>
    </div>
    <!--Sub Banner Wrap End -->
    <!--Breadcrumb Wrap End -->
    <div class="gt_breadcrumb_bg default_width">
      <div class="container">
        <div class="gt_breadcrumb_wrap default_width">
            <ul>
                <li><a href="/pages/index.html">首页</a></li>
                <li><a href="#">登录 / 注册</a></li>
            </ul>
        </div>
      </div>
    </div>
    <!--Breadcrumb Wrap End -->

    <!--Main Content Wrap Start-->
    <div class="gt_content_wrap">
      <!--Login & Register Page Wrap Start-->
      <section>
        <div class="container">
          <div class="gt_lgin_tab_wrap">
            <ul class="gt_login_link"  data-tabs="tabs">
              <li><a data-toggle="tab" href="#register">注册</a></li>
              <li class="active"><a data-toggle="tab" href="#login">登录</a></li>
            </ul>
            <div class="tab-content">
              <div class="tab-pane active" id="login">
                <div class="gt_login_des_wrap default_width">
                  <div class="gt_login_field">
                    <input id="LoginMobile" type="text" placeholder="用户名">
                    <label><i class="fa fa-envelope"></i></label>
                  </div>
                  <div class="gt_login_field">
                    <input id="LoginPassword" type="password" placeholder="密码">
                    <label><i class="fa fa-lock"></i></label>
                  </div>

                  <div class="gt_login_radio_btn" style="float: right; width: 76px; margin: 0px 12px 14px; cursor: pointer;">
                    <!-- <input id="2" type="checkbox"> -->
                    <a href="/pages/ymdx/login-register/forgetpwd.html">忘记密码</a>
                  </div>

                  <div class="gt_login_field">
                    <input id="UserLogin" type="submit" value="登录">
                  </div>
                </div>
              </div>

              <div class="tab-pane" id="register">
                <div class="gt_login_des_wrap default_width">
                  <div class="gt_login_field">
                    <input id="RegisterMobile" type="text" placeholder="手机号">
                    <label><i class="fa fa-user"></i></label>
                  </div>
                  <div class="gt_login_field">
                    <input id="VerificationCode" type="text" placeholder="手机验证码" style="width: 60%;">
                    <input id="getting" onclick="getVerificationCode()" type="submit" value="获取验证码" style="width: 38%; height: 45px; font-size: 14px; line-height: 14px; margin: 0px 3px 0px; float: right;">
                    <label><i class="fa fa-user"></i></label>
                  </div>
                  <div class="gt_login_field">
                    <input type="text" placeholder="学员姓名">
                    <label><i class="fa fa-envelope"></i></label>
                  </div>
                  <div class="gt_login_field">
                    <input id="RegisterPassword" type="password" placeholder="密码">
                    <label><i class="icon-lock"></i></label>
                  </div>
                  <div class="gt_login_field">
                    <input id="AgainPassword" type="password" placeholder="再次密码">
                    <label><i class="icon-lock"></i></label>
                  </div>
                  <div class="gt_login_field">
                    <input id="UserRegister" type="submit" value="注册">
                  </div>
                </div>
              </div>

              <script type="text/javascript">
                $(function(){
                    /*仿刷新：检测是否存在cookie*/
                    if($.cookie("captcha")){
                        var count = $.cookie("captcha");
                        var btn = $('#getting');
                        btn.val(count+'秒后可重新获取').attr('disabled',true).css('cursor','not-allowed');
                        var resend = setInterval(function(){
                            count--;
                            if (count > 0){
                                btn.val(count+'秒后可重新获取').attr('disabled',true).css('cursor','not-allowed');
                                $.cookie("captcha", count, {path: '/', expires: (1/86400)*count});
                            }else {
                                clearInterval(resend);
                                btn.val("获取验证码").removeClass('disabled').removeAttr('disabled style');
                            }
                        }, 1000);
                    }
                    /*点击改变按钮状态，已经简略掉ajax发送短信验证的代码*/
                    $('#getting').click(function(){
                        var btn = $(this);
                        var count = 120;
                        var resend = setInterval(function(){
                            count--;
                            if (count > 0){
                                btn.val(count+"秒后可重新获取");
                                $.cookie("captcha", count, {path: '/', expires: (1/86400)*count});
                            }else {
                                clearInterval(resend);
                                btn.val("获取验证码").removeAttr('disabled');
                            }
                        }, 1000);
                        btn.attr('disabled',true).css('cursor','not-allowed');
                    });
                });
              </script>

            </div>
          </div>
        </div>
      </section>
      <!--Login & Register Page Wrap End-->
    </div>
    <!--Main Content Wrap End-->


    <!--Footer List Wrap Start-->
    <footer>
      <div class="gt_footer2_bg default_width">
        <div class="container">
          <div class="row">
            <div class="col-md-3 col-sm-6">
              <div class="gt_foo_logo_wrap default_width">
                <a href="#"><img src="/pages/images/footer-logo.png" alt=""></a>
                  <p>L我们致力于打造最优质的少儿编程课业体系，立志在中国青少年群体中推广程序设计，让更多的孩子爱上编程，让更多的程序mead in china。</p>
                  <span><a href="/pages/ymdx/showpages/aboutus.html">详情</a></span>
              </div>
            </div>
            <div class="col-md-3 col-sm-6">
              <div class="gt_foo2_link gt_widget2_hdg">
                  <h5>Quick links</h5>
                  <ul>
                      <li><a href="/pages/index.html">首页</a></li>
                      <li><a href="/pages/ymdx/course/course.html">课程介绍</a></li>
                      <li><a href="/pages/ymdx/showpages/showworks.html">作品展示</a></li>
                      <li><a href="/pages/ymdx/news/news.html">新闻资讯</a></li>
                  </ul>
                  <ul>
                      <li><a href="/pages/ymdx/showpages/aboutus.html">关于我们</a></li>
                      <li><a href="/pages/ymdx/showpages/cooperation.html">企业合作</a></li>
                  </ul>
              </div>
            </div>
            <div class="col-md-3 col-sm-6">
              <div class="gt_foo_news gt_widget2_hdg">
                <h5>Recent Activities</h5>
                <ul>
                  <li>
                    <figure>
                      <img src="/pages/extra-images/testimonial-01.jpg" alt="">
                    </figure>
                    <div class="foo_news_content">
                      <a href="#">blalalalalablabla</a>
                    </div>
                  </li>
                  <li>
                    <figure>
                      <img src="/pages/extra-images/testimonial-02.jpg" alt="">
                    </figure>
                    <div class="foo_news_content">
                      <a href="#">blalalalalablabla</a>
                    </div>
                  </li>
                  <li>
                    <figure>
                      <img src="/pages/extra-images/testimonial-03.jpg" alt="">
                    </figure>
                    <div class="foo_news_content">
                      <a href="#">blalalalalablabla</a>
                    </div>
                  </li>
                </ul>
              </div>
            </div>
            <div class="col-md-3 col-sm-6">
              <div class="gt_widget2_hdg">
                <h5>Contact Us</h5>
                <p>欢迎关注公众号“壹码当先”，更多干货尽在分享</p>
                <ul class="gt_team1_contact_info">
                  <li><i class="fa fa-map-marker"></i>XXXXXXXXX </li>
                  <li><i class="fa fa-phone"></i>XXXXXXXXX </li>
                  <li><i class="fa fa-envelope"></i> <a href="#">iXXXXXXXX</a> </li>
                  <li><i class="fa fa-phone"></i>XXXXXXXX</li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--Footer List Wrap End-->
      </div>
      </div>
      <!--Footer List Wrap End-->

      <!--Copyright Wrap End-->
      <div class="gt_copyright_wrap copyright2_bg">
        <div class="container">
            <div class="gt_copyright_des">  
                <p>Copyright © <a href="#">Edu-skill </a> 2016. All rights reserved.</p>
                <span>Created by: <a href="#">2goodtheme.com</a></span>
              </div>
          </div>
      </div>
      <!--Copyright Wrap Start-->

    <!-- sevice -->
      <div id="service">
      <ul>
          <li>
              <a href="#" class="zaixiankefu">
                  <img src="/pages/images/kefu/kefu.png" width="47" height="49"/>
              </a>
          </li>
          <li>
              <a href="javascript:void(0)" class="weixin_area">
                  <img src="/pages/images/kefu/weixin1.png" width="47" height="49" class="shows" />
                  <!-- <img src="../../images/kefu/weixin2.png" width="57" height="49" class="hides" /> -->
                  <img src="/pages/images/kefu/erweima.jpg" width="145" class="weixin" style="display:none;margin:-100px 57px 0 0; z-index: 2" />
              </a>
          </li>
          <li>
              <a href="#" target="_blank">
                  <div class="hides" style="width:161px;display:none;" id="qq">
                      <div class="hides" id="p1">
                          <img src="/pages/images/kefu/qq1.png">
                      </div>
                        <div class="hides" id="p2"><span style="color:#FFF;font-size:13px">XXXXXXXXXX</span>
                      </div>
                  </div>
                  <img src="/pages/images/kefu/qq2.png" width="47" height="49" class="shows" />
              </a>
          </li>
          <li id="tel">
              <a href="javascript:void(0)">
                  <div class="hides" style="width:161px;display:none;" id="tels">
                      <div class="hides" id="p1">
                          <img src="/pages/images/kefu/tel1.png">
                      </div>
                      <div class="hides" id="p3"><span style="color:#FFF;font-size:12px">XXXXXXXXXXX</span>
                      </div>
                  </div>
                  <img src="/pages/images/kefu/tel2.png" width="47" height="49" class="shows" />
              </a>
          </li>
          <li id="btn">
              <a id="top_btn">
                  <div class="hides" style="width:161px;display:none">
                      <img src="/pages/images/kefu/end1.png" width="161" height="49" />
                  </div>
                  <img src="/pages/images/kefu/end2.png" width="47" height="49" class="shows" />
              </a>
          </li>
      </ul>
      </div>
      <script type="text/javascript">
      $(function() {
          $("#service a").hover(function() {
              if ($(this).prop("className") == "weixin_area") {
                  $(this).children("img.hides").show();
              } else {
                  $(this).children("div.hides").show();
                  $(this).children("img.shows").hide();
                  $(this).children("div.hides").animate({marginRight: '0px'}, '0');
              }
          }, function() {
              if ($(this).prop("className") == "weixin_area") {
                  $(this).children("img.hides").hide();
              } else {
                  $(this).children("div.hides").animate({marginRight: '-163px'}, 0, function() {
                      $(this).hide();
                      $(this).next("img.shows").show();
                  });
              }
          });

          $("#top_btn").click(function() {
              $("html,body").animate({scrollTop: 0}, 600);
          });

          //右侧导航 - 二维码
          $(".weixin_area").hover(function() {
              $(this).children(".weixin").show();
          },function(){
              $(this).children(".weixin").hide();
          })
      });
      </script>
    </footer>
    <!--Footer Wrap End-->
    
  </div>
  <!--gt Wrapper End-->

  <!--Jquery Library-->
  <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
  <!--Bootstrap core JavaScript-->
  <script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
  <!--Custom JavaScript-->
  <script src="/pages/js/custom.js"></script>
  <script src="/pages/js/jquery.cookie.js"></script>

</body>
</html>
